<template>
<i-form :model="article" :label-width="90" ref="formSaveArticle" :rules="formSaveArticle">
    <Form-item label="标题：" prop="title">
		<i-input  v-model="article.title" placeholder="请输入50字以内标题"></i-input>
	</Form-item>
    <Form-item label="作者：" prop="author">
		<i-input  v-model="article.author" style="width:200px" placeholder="作者"></i-input>
	</Form-item>
       <Form-item label="简介：" prop="intro">
		<i-input type="textarea" v-model="article.intro" placeholder="请输入200字以内的简介"></i-input>
	</Form-item>
       <Form-item label="内容：" prop="content">
	  	<vue-editor v-model="article.content" v-text="article.content"></vue-editor>
	</Form-item>
    <Form-item label="LOGO：" prop="logoImg">
       	<Upload ref="logoImg" :show-upload-list="false" :format="['jpg','jpeg','png','png','gif']" style="display: inline-block;width:58px;" type="drag" 
       		:on-success="uploadSuccess" name="file" 
       		action="/file/upload">
       		<div style="width: 58px;height:58px;line-height: 58px;">
	            <Icon type="camera" size="20"></Icon>
	        </div>
	    </Upload>
      		<div style="width: 60px;height:60px;line-height: 60px;margin-left:4px;border: 1px solid transparent;background: #fff;display: inline-block;position: relative;overflow: hidden;">
          <template v-if="logoUrl !== ''">
     				<img :src="logoUrl" style="width: 100%;height:100%;border:none"/>
     			  </template>
        </div>
	</Form-item>
    <Form-item label="关键字：" prop="keywords">
		<i-input v-model="article.keywords" placeholder="关键字，多个之间逗号分隔"></i-input>
	</Form-item>
    <Form-item label="分类：" prop="channelId">
       	<i-select v-model="article.channelId" style="width:200px">
	        <i-option v-for="item in channels" :value="item.id" :key="item">{{ item.name }}</i-option>
	    </i-select>
	</Form-item>
	<Form-item>
		<i-button type="success" v-on:click="save" size="large" icon="compose">保存</i-button>
	</Form-item>
</i-form>
</template>